<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>09-location对象</title>
</head>
<body>

<button onclick="fn1()">设置/获取当前URL</button>
<button onclick="fn2()">刷新页面</button>

</body>
<script>

    /**
     * 设置/获取当前URL
     */
    function fn1() {
        console.log("当前URL = " + location.href);
        location.href = "/day01/index.html";
    }

    /**
     * 刷新页面
     */
    function fn2() {
        location.reload();
    }

</script>
</html>